#include <iostream>
#include <vector>

template<typename T>
void sort(std::vector<T>& data)
{
    int N = data.size();
    for(int i = 0;i<N;i++)
    {
        int min = i;
        for(int j = i+1; j < N;j++)
        {
            if(data[j] < data[min])
                min = j;
        }
        if(min != i)
        {
            std::swap(data[i],data[min]);
        }
    }
}

int main() {
    std::vector<int> nums = {64, 25, 12, 22, 11};
    
    sort(nums); 
    
    std::cout << "排序后的数组: ";
    for (int num : nums) {
        std::cout << num << " ";
    }
    std::cout << std::endl;

    std::vector<double> doubles = {3.14, 1.41, 2.71, 0.99};
    sort(doubles);
    
    std::cout << "排序后的浮点数: ";
    for (double d : doubles) {
        std::cout << d << " ";
    }
    std::cout << std::endl;
    
    return 0;
}